﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class CMS_Control_Notice : System.Web.UI.UserControl
{
    Usas.BLL.Cms.cms_block_common_detail cbcd = new Usas.BLL.Cms.cms_block_common_detail();
    Usas.Model.Cms.cms_block_common_detail cbcdm = new Usas.Model.Cms.cms_block_common_detail();
    Usas.BLL.Cms.cms_block cb = new Usas.BLL.Cms.cms_block();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            string id = cb.GetList("b_path='Notice.ascx'").Tables[0].Rows[0]["b_id"].ToString();
            string type = System.IO.Path.GetFileName(HttpContext.Current.Request.Path);

            DataSet ds = cbcd.GetList("c_b_id=" + id + " and c_type='" + type + "'");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                litnotice.Text = "<div id='scrollDiv'><div class='scrollText'><ul>";
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    litnotice.Text += "<li><img src='images/notice.gif' style='margin-top:4px;'>&nbsp;&nbsp;公告： " + ds.Tables[0].Rows[i]["c_value"].ToString() + "</li>";
                 
                }
                litnotice.Text += "</ul></div>";

                litnotice.Text += "</div><br /><!--[if IE 6]><br /><![endif]-->";
            }

        }
    }
}
